﻿// 说明1：函数测试通过以后，再改为cin,cout。
// 说明2：写算法，尽量不依赖于C++的日期类型，而是自己通过遍历来计算。

#include <bits/stdc++.h>
using namespace std;

bool isLeapYear(int n) {
    if (n % 400 == 0) {
        return true;
    }if (n % 100 != 0 && n % 4 == 0) {
        return true;
    }
    return false;
}

string calc(int n, int startYear, int muBiao) {
    int t = 1;
    //定义每个月有多少天(闰年另外计算)
    int m[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
    int a[7]  = { 0,0,0,0,0,0,0 };
    for (int i = startYear; i < n + startYear; i++) {
        if (isLeapYear(i)) {
            m[1] = 29;
        }
        else {
            m[1] = 28;
        }
        for (int j = 0; j < 12; j++) {
            for (int k = 1; k <= m[j]; k++) {
                t++;
                if (t == 8) {
                    t = 1;
                }
                if (k == muBiao) {
                    a[t - 1]++;
                }
            }
        }
    }

    string result = to_string(a[6]) + " ";
    for (int j = 0; j < 6; j++) {
        if (j > 0) {
            result += " ";
        }
        result += to_string(a[j]);
    }
    return result;
}

void test1() {
    int n = 20;
    int startYear = 1900;
    int muBiao = 13;
    string expectValue = "36 33 34 33 35 35 34";
    string realValue = calc(n, startYear, muBiao);
    cout << (expectValue == realValue ? "T" : "F");
}

int main() {
    test1();
    return 0;
}